{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "from scipy.stats import binom  # 导入伯努利分布的实例\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "plt.rcParams['figure.figsize']=(15,5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "n,p1,p2=10,0.25,0.9   #设置相关参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA3gAAAFbCAYAAACHySz/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3X+cXVV97//XW4OiBDXqKIUAkasFqrYqsVoEFb7WtoCIaWkjyq02lHq/KopU9Kuttba37VfEKvYLNVqhFC+KAr1SUrDtIyDRVgkCIlppNfIjFm6CFRW0YPx8/9h7zOEwkzlzmDlnsuf1fDzOY89Ze+21PluHWfnsvdfaqSokSZIkSTu/h4w7AEmSJEnS3DDBkyRJkqSOMMGTJEmSpI4wwZMkSZKkjjDBkyRJkqSOMMGTJEmSpI4wwdOil+SXklyR5PtJtiT5iyS7jjsuSZLGyfFR2jmZ4GlRS3IKcBnwH8DJwCXAa4H3j6j/hyQ5Ocm/JvlhkluTnJ5ktwGP/+kk70ryL+3g+70k1yV5+1RtJKlpPt+fj/gkSTunnX18bNt4YpK/bI+9N8ktSd6f5DEPtj/HRy1k8UXnWqySvAj4NHBqVb2np/wy4DBgoqq+O88xvB84CbgY+HvgQOD1wFXAi6rqxzMc/2c0A+6ngH8B7qOJ/deBLwHPraof9NSvtu21fU3dV1Ufn+v4JEk7n46Mj08AvgDsCXwQ+DLwNOB3gBuB51XVPcP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ZMkSdKCM+gF0Lbu64F/qqqvzH9k0sJmgidJkiRJHeEcPEmSJEnqCBM8SZIkSeoIEzxJkiRJ6ggTPEmSJEnqCBM8SZIkSeqI/x+DW0G22d/piwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1080x360 with 2 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fontdict = {'family': 'Times New Roman', 'weight': 'normal', 'size': 18}\n",
    "x1 = np.arange(binom.ppf(0,n,p1),\n",
    "             binom.ppf(1,n,p1)+1)\n",
    "ax1=plt.subplot(121)\n",
    "ax1.plot(x1,binom.pmf(x1,n,p1),'bo',ms=1)\n",
    "ax1.vlines(x1, 0, binom.pmf(x1, n, p), colors='b', lw=20, alpha=1)\n",
    "ax1.set_xlim((-0.9,10.9))\n",
    "ax1.set_ylim((0,0.35))\n",
    "ax1.xaxis.set_major_locator(plt.MultipleLocator(1.0))\n",
    "ax1.set_xlabel('(a)',fontdict=fontdict)\n",
    "ax1.tick_params(labelsize=15)\n",
    "ax1.set_title(r'$\\theta=0.250$',fontdict=fontdict)\n",
    "\n",
    "x2 = np.arange(binom.ppf(0,n,p2),\n",
    "             binom.ppf(1,n,p2)+1)\n",
    "ax2=plt.subplot(122)\n",
    "ax2.plot(x2,binom.pmf(x2,n,p2),'bo',ms=1)\n",
    "ax2.vlines(x2, 0, binom.pmf(x2, n, p2), colors='b', lw=20, alpha=1)\n",
    "ax2.set_xlim((-0.9,10.9))\n",
    "ax2.set_ylim((0,0.4))\n",
    "ax2.xaxis.set_major_locator(plt.MultipleLocator(1.0))\n",
    "ax2.set_xlabel('(b)',fontdict=fontdict)\n",
    "ax2.tick_params(labelsize=15)\n",
    "ax2.set_title(r'$\\theta=0.900$',fontdict=fontdict)\n",
    "\n",
    "labels = ax1.get_xticklabels() + ax1.get_yticklabels()+ax2.get_xticklabels() + ax2.get_yticklabels()\n",
    "temp=[label.set_fontname('Times New Roman') for label in labels]\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
